home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 83
/
(Vol 83) My Disc.iso
/
Games
/
chees_mouse.swf
/
scripts
/
frame_3
/
DoAction.as
Wrap
Text File
|
2008-08-08
|
6KB
|
163 lines
function build_m()
{
attachMovie("empty","c",1);
c._x = 25;
c._y = 50;
var _loc7_ = 0;
var _loc6_ = t_hor * t_ver + 2;
if(_root["e5_pos_" + current_l_num].length == undefined && _root["ch_pos_" + current_l_num].length == undefined)
{
var _loc5_ = _loc6_ + 1;
}
else if(_root["e5_pos_" + current_l_num].length != undefined && _root["ch_pos_" + current_l_num].length == undefined)
{
_loc5_ = _loc6_ + _root["e5_pos_" + current_l_num].length + 1;
}
else if(_root["e5_pos_" + current_l_num].length == undefined && _root["ch_pos_" + current_l_num].length != undefined)
{
_loc5_ = _loc6_ + _root["ch_pos_" + current_l_num].length + 1;
}
else if(_root["e5_pos_" + current_l_num].length != undefined && _root["ch_pos_" + current_l_num].length != undefined)
{
_loc5_ = _loc6_ + _root["e5_pos_" + current_l_num].length + _root["ch_pos_" + current_l_num].length + 1;
}
var _loc3_ = 0;
while(_loc3_ < t_ver)
{
var _loc2_ = 0;
while(_loc2_ < t_hor)
{
c.attachMovie("t","t_" + _loc2_ + "_" + _loc3_,_loc7_);
c["t_" + _loc2_ + "_" + _loc3_]._x = _loc2_ * t_size;
c["t_" + _loc2_ + "_" + _loc3_]._y = _loc3_ * t_size;
c["t_" + _loc2_ + "_" + _loc3_].gotoAndStop(current_m[_loc3_][_loc2_] + 1);
_loc7_ = _loc7_ + 1;
var _loc4_ = 0;
while(_loc4_ < _root["e1_pos_" + current_l_num].length)
{
if(_loc2_ == _root["e1_pos_" + current_l_num][_loc4_][0] && _loc3_ == _root["e1_pos_" + current_l_num][_loc4_][1])
{
c.attachMovie("e1","e1_" + _loc4_,_loc5_);
c["e1_" + _loc4_]._x = _loc2_ * t_size + t_size / 2;
c["e1_" + _loc4_]._y = _loc3_ * t_size + t_size / 2;
_loc5_ = _loc5_ + 1;
}
_loc4_ = _loc4_ + 1;
}
_loc4_ = 0;
while(_loc4_ < _root["e2_pos_" + current_l_num].length)
{
if(_loc2_ == _root["e2_pos_" + current_l_num][_loc4_][0] && _loc3_ == _root["e2_pos_" + current_l_num][_loc4_][1])
{
c.attachMovie("e2","e2_" + _loc4_,_loc5_);
c["e2_" + _loc4_]._x = _loc2_ * t_size + t_size / 2;
c["e2_" + _loc4_]._y = _loc3_ * t_size + t_size / 2;
_loc5_ = _loc5_ + 1;
}
_loc4_ = _loc4_ + 1;
}
_loc4_ = 0;
while(_loc4_ < _root["e3_pos_" + current_l_num].length)
{
if(_loc2_ == _root["e3_pos_" + current_l_num][_loc4_][0] && _loc3_ == _root["e3_pos_" + current_l_num][_loc4_][1])
{
c.attachMovie("e3","e3_" + _loc4_,_loc5_);
c["e3_" + _loc4_]._x = _loc2_ * t_size + t_size / 2;
c["e3_" + _loc4_]._y = _loc3_ * t_size + t_size / 2;
_loc5_ = _loc5_ + 1;
}
_loc4_ = _loc4_ + 1;
}
_loc4_ = 0;
while(_loc4_ < _root["e4_pos_" + current_l_num].length)
{
if(_loc2_ == _root["e4_pos_" + current_l_num][_loc4_][0] && _loc3_ == _root["e4_pos_" + current_l_num][_loc4_][1])
{
c.attachMovie("e4","e4_" + _loc4_,_loc5_);
c["e4_" + _loc4_]._x = _loc2_ * t_size + t_size / 2;
c["e4_" + _loc4_]._y = _loc3_ * t_size + t_size / 2;
_loc5_ = _loc5_ + 1;
}
_loc4_ = _loc4_ + 1;
}
_loc4_ = 0;
while(_loc4_ < _root["e5_pos_" + current_l_num].length)
{
if(_loc2_ == _root["e5_pos_" + current_l_num][_loc4_][0] && _loc3_ == _root["e5_pos_" + current_l_num][_loc4_][1])
{
c.attachMovie("e5","e5_" + _loc4_,_loc6_);
c["e5_" + _loc4_]._x = _loc2_ * t_size + t_size / 2;
c["e5_" + _loc4_]._y = _loc3_ * t_size + t_size / 2;
_loc6_ = _loc6_ + 1;
}
_loc4_ = _loc4_ + 1;
}
_loc4_ = 0;
while(_loc4_ < _root["ch_pos_" + current_l_num].length)
{
if(_loc2_ == _root["ch_pos_" + current_l_num][_loc4_][0] && _loc3_ == _root["ch_pos_" + current_l_num][_loc4_][1])
{
c.attachMovie("ch","ch_" + _loc4_,_loc6_);
c["ch_" + _loc4_]._x = _loc2_ * t_size + t_size / 2;
c["ch_" + _loc4_]._y = _loc3_ * t_size + t_size / 2;
_loc6_ = _loc6_ + 1;
}
_loc4_ = _loc4_ + 1;
}
if(_loc2_ == _root["mh_pos_" + current_l_num][0] && _loc3_ == _root["mh_pos_" + current_l_num][1])
{
c.attachMovie("mh","mh",_loc6_);
c.mh._x = _loc2_ * t_size + t_size / 2;
c.mh._y = _loc3_ * t_size + t_size / 2;
_loc6_ = _loc6_ + 1;
}
_loc2_ = _loc2_ + 1;
}
_loc3_ = _loc3_ + 1;
}
if(c.p._x == null)
{
c.attachMovie("p","p",_loc5_);
c.p._x = _root["p_pos_" + current_l_num][0] * t_size + t_size / 2;
c.p._y = _root["p_pos_" + current_l_num][1] * t_size + t_size / 2;
}
}
function break_m()
{
removeMovieClip(c);
}
function write_texts()
{
stats = "Level: " + current_l_num + "/" + total_l + " " + "Cheese: " + ch_amt + "/" + _root["ch_pos_" + current_l_num].length;
if(_root["ch_pos_" + current_l_num].length == undefined)
{
stats = "Level: " + current_l_num + "/" + total_l + " " + "Cheese: " + ch_amt + "/0";
}
}
function die()
{
ch_amt = 0;
break_m();
removeMovieClip(c.p);
gotoAndStop("pregame");
}
function win()
{
current_l_num++;
current_m = _root["m_" + current_l_num];
ch_amt = 0;
break_m();
removeMovieClip(c.p);
gotoAndStop("pregame");
}
var total_l = 15;
stop();
_quality = "high";
var t_size = 20;
var m_width = 300;
var m_height = 300;
var t_hor = m_width / t_size;
var t_ver = m_height / t_size;
var p_action = null;
var ch_amt = 0;